/**
* Joel Filipe Antunes Cordeiro N 2006124250
* 
**/

function submenu(id)
{
	if(id=="sub-menu-1"){
		if (document.getElementById)
		{
			var layerStyle1 = document.getElementById(id).style;
			var layerStyle2 = document.getElementById(id+"-1").style;
			var image = document.getElementById(id+"-img");
			
			if (layerStyle1.display == "none" && layerStyle2.display == "none") {
				image.src = "imagens/up.png";
				layerStyle1.display = "block";
				layerStyle2.display = "block";			
			}
			else {
				image.src = "imagens/down.png";
				layerStyle1.display = "none";
				layerStyle2.display = "none";
			}
		}
		else if (document.all)
		{
			var layerStyle1 = document.getElementById(id).style;
			var layerStyle2 = document.getElementById(id+"-1").style;
			var image = document.getElementById(id+"-img");
			
			if (layerStyle1.display == "none" && layerStyle2.display == "none") {
				image.src = "imagens/up.png";
				layerStyle1.display = "block";
				layerStyle2.display = "block";			
			}
			else {
				image.src = "imagens/down.png";
				layerStyle1.display = "none";
				layerStyle2.display = "none";
			}
		}
		else if (document.layers)
		{
			var layerStyle1 = document.getElementById(id).style;
			var layerStyle2 = document.getElementById(id+"-1").style;
			var image = document.getElementById(id+"-img");
			
			if (layerStyle1.display == "none" && layerStyle2.display == "none") {
				image.src = "imagens/up.png";
				layerStyle1.display = "block";
				layerStyle2.display = "block";			
			}
			else {
				image.src = "imagens/down.png";
				layerStyle1.display = "none";
				layerStyle2.display = "none";
			}		
		}
		else if (document.all)
		{
			var layerStyle1 = document.getElementById(id).style;
			var layerStyle2 = document.getElementById(id+"-1").style;
			var layerStyle3 = document.getElementById(id+"-2").style;
			var image = document.getElementById(id+"-img");
			
			if (layerStyle1.display == "none" && layerStyle2.display == "none") {
				image.src = "imagens/up.png";
				layerStyle1.display = "block";
				layerStyle2.display = "block";			
				layerStyle3.display = "block";	
			}
			else {
				image.src = "imagens/down.png";
				layerStyle1.display = "none";
				layerStyle2.display = "none";
				layerStyle3.display = "block";	
			}
		}
		else if (document.layers)
		{
			var layerStyle1 = document.getElementById(id).style;
			var layerStyle2 = document.getElementById(id+"-1").style;
			var layerStyle3 = document.getElementById(id+"-2").style;
			var image = document.getElementById(id+"-img");
			
			if (layerStyle1.display == "none" && layerStyle2.display == "none") {
				image.src = "imagens/up.png";
				layerStyle1.display = "block";
				layerStyle2.display = "block";		
				layerStyle3.display = "block";	
			}
			else {
				image.src = "imagens/down.png";
				layerStyle1.display = "none";
				layerStyle2.display = "none";
				layerStyle3.display = "block";	
			}
		}
	}
}